import java.util.ArrayList;

import Utils.ListUtil;
import Utils.RETool;

public class Currency {
	// 抽取货币
	public static ArrayList<String> extractCurrency(String string) {
		ArrayList<String> result = new ArrayList<String>();
		ArrayList<String> expressions = new ArrayList<String>();
		String number = "[[0.]*\\d|" + RETool.ZH_NUMBER + "|几]+";
		expressions.add(number + "[多]*(分|毛|角|元|美元|块|百|千|k|万|w|十万|百万|千万|亿)[" + number + "]*[元|块]*");

		for (int i = 0; i < expressions.size(); i++) {
			ArrayList<String> tmp = RETool.extract(string, expressions.get(i));
			result = ListUtil.merge(result, tmp);
		}

		return result;
	}

	public static void main(String args[]) {
		// 测试货币
		// String items[] = { "1元1块", "2毛2角", "三万元3万元三万块3万块", "三千元3千元三千块3千块",
		// "4k", "五千元5千元五千块5千块" };
		// String string = "";
		// for (int i = 0; i < items.length; i++)
		// string += items[i] + "cdfbvf";
		// ArrayList<String> results = extractCurrency(string);
		// for (int i = 0; i < results.size(); i++)
		// System.out.println("[" + i + "]:" + results.get(i));
	}
}
